<?php
class Fxy_add_ctl extends Ctl{
    function __construct(){
    }
    function main(array $xxfget) {
        $this::sessver();
        $type=!empty($_POST['type'])?$_POST['type']:false;
        if(!$type){
        	$result=xdb::getInstance()->getrow('select * from peixunxueyuan where id='.$xxfget['puid']);
        	$this::show('fxy_add',compact('result'));
        }elseif ($type=="add"){
        	$array=array();
        	$array2=array();
        	$uid=$_POST['uid'];
        	$shiqi=$_POST['shiqi'];
        	$bzrid=$_POST['bzrid'];
        	$pname=$_POST['pname'];
        	$array['uid']=$uid;
        	$array['shiqi']=$shiqi;
        	$array['pname']=$pname;
        	$array['bzrid']=$bzrid;
        	$array2['shiqi']=$shiqi;
        	$array2['pname']=$pname;
        	echo xdb::getInstance()->indb('peixunban', $array, $array2);
        }elseif ($type=="del"){
        	$array=array();
        	$id=$_POST['pid'];
        	$array['id']=$id;
        	echo xdb::getInstance()->deldb('peixunban', $array);
        }
    }
}